<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class StoreArticleRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'title'     =>  'required',
            'author_from'  =>  'required',
            'content'      =>  'required'
        ];
    }

    public function messages()
    {
        return [
            'title.required'    =>  '<i class=\'fa fa-times-circle-o\'></i>文章标题必填!&nbsp;',
            'author_from.required' =>  '<i class=\'fa fa-times-circle-o\'></i>文章来源必填!&nbsp;',
            'content.required'     =>  '<i class=\'fa fa-times-circle-o\'></i>文章内容必填!&nbsp;'
        ];
    }
}
